/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.star.modules.sys.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 图片管理Entity
 * @author L
 * @version 2018-09-03
 */
@Table(name="${_prefix}pic", alias="a", columns={
		@Column(name="id", attrName="id", label="用户ID", isPK=true),
		@Column(name="name", attrName="name", label="图片名字", queryType=QueryType.LIKE),
		@Column(name="pic_addr", attrName="picAddr", label="图片地址"),
		@Column(name="link", attrName="link", label="跳转地址"),
		@Column(name="display_order", attrName="displayOrder", label="显示顺序"),
		@Column(name="jump_type", attrName="jumpType", label="跳转方式", comment="跳转方式(字典)"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.status , a.display_order DESC , a.create_date desc"
)
public class ShPic extends DataEntity<ShPic> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// 图片名字
	private String picAddr;		// 图片地址
	private String link;		// 跳转地址
	private Long displayOrder;		// 显示顺序
	private String jumpType;		// 跳转方式(字典)
	
	public ShPic() {
		this(null);
	}

	public ShPic(String id){
		super(id);
	}
	
	@NotBlank(message="图片名字不能为空")
	@Length(min=0, max=40, message="图片名字长度不能超过 40 个字符")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getPicAddr() {
		return picAddr;
	}

	public void setPicAddr(String picAddr) {
		this.picAddr = picAddr;
	}
	
	@NotBlank(message="跳转地址不能为空")
	@Length(min=0, max=150, message="跳转地址长度不能超过 150 个字符")
	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}
	
	@NotNull(message="显示顺序不能为空")
	public Long getDisplayOrder() {
		return displayOrder;
	}

	public void setDisplayOrder(Long displayOrder) {
		this.displayOrder = displayOrder;
	}
	
	@NotBlank(message="跳转方式不能为空")
	@Length(min=0, max=20, message="跳转方式长度不能超过 20 个字符")
	public String getJumpType() {
		return jumpType;
	}

	public void setJumpType(String jumpType) {
		this.jumpType = jumpType;
	}
	
}